package vn.bus.models;

import java.sql.Connection;
import java.util.ArrayList;

import vn.bus.dao.Database;
import vn.bus.dao.RouteDAO;
import vn.bus.dto.RouteDTO;

public class RouteManager {

	public ArrayList<RouteDTO> getAllRoutes()throws Exception {
		ArrayList<RouteDTO> allRoutes = null;
		try {
			    Database database= new Database();
			    Connection connection = database.Get_Connection();
			    RouteDAO Route = new RouteDAO();
			    allRoutes = Route.getAllRoutes(connection);
			    connection.close();
		
		} catch (Exception e) {
			throw e;
		}
		return allRoutes;
	}
}
